<?php
/*由bean脚本生成 powerBy--joe*/

namespace app\common\validate;

use app\common\bean\StoreBean;

class StoreValidate extends BaseValidate
{

    static $all = 'all';
    static $add = 'add';
    static $edit = 'edit';
    static $pkId = 'id';

    static $list = 'list';

    public function __construct(array $rules = [], array $message = [], array $field = [])
    {
        parent::__construct($rules, $message, $field);
        $this->rule = [
            StoreBean::$id => 'require', //
            StoreBean::$userId => 'require', //申请用户id
            StoreBean::$serialNumber => 'require|max:255', //公司编号
            StoreBean::$contactPhone => 'require|max:255', //商家手机号
            StoreBean::$email => 'require|max:255', //商家邮箱
            StoreBean::$companyName => 'require|max:255', //商家店铺名称
            StoreBean::$contactName => 'require|max:255', //联系人
            StoreBean::$contactAddr => 'require|max:255', //客户联系地址
            StoreBean::$signedAt => 'require', //审核日期
            StoreBean::$contactAddrLng => 'require|max:255', //地址经度
            StoreBean::$contactAddrLat => 'require|max:255', //地址维度
            StoreBean::$attachment => 'require|max:255', //附件文件
            StoreBean::$status => 'require', //1待审核、2审核失败，3审核通过
            StoreBean::$memo => 'require|max:255', //备注
            StoreBean::$rate => 'require', //6/1000 微信点数
            StoreBean::$openVip => 'require', //会员价 1 不开启、2开启
            StoreBean::$blance => 'require', //商家余额
            StoreBean::$updatedAt => 'require', //
            StoreBean::$createdAt => 'require', //
        ];
        $this->message = [
            StoreBean::$id . POINST . "require " => 'id必须', //
            StoreBean::$userId . POINST . "require " => 'user_id必须', //申请用户id
            StoreBean::$serialNumber . POINST . "require " => 'serial_number必须', //公司编号
            StoreBean::$contactPhone . POINST . "require " => 'contact_phone必须', //商家手机号
            StoreBean::$email . POINST . "require " => 'email必须', //商家邮箱
            StoreBean::$companyName . POINST . "require " => 'company_name必须', //商家店铺名称
            StoreBean::$contactName . POINST . "require " => 'contact_name必须', //联系人
            StoreBean::$contactAddr . POINST . "require " => 'contact_addr必须', //客户联系地址
            StoreBean::$signedAt . POINST . "require " => 'signed_at必须', //审核日期
            StoreBean::$contactAddrLng . POINST . "require " => 'contact_addr_lng必须', //地址经度
            StoreBean::$contactAddrLat . POINST . "require " => 'contact_addr_lat必须', //地址维度
            StoreBean::$attachment . POINST . "require " => 'attachment必须', //附件文件
            StoreBean::$status . POINST . "require " => 'status必须', //1待审核、2审核失败，3审核通过
            StoreBean::$memo . POINST . "require " => 'memo必须', //备注
            StoreBean::$rate . POINST . "require " => 'rate必须', //6/1000 微信点数
            StoreBean::$openVip . POINST . "require " => 'open_vip必须', //会员价 1 不开启、2开启
            StoreBean::$blance . POINST . "require " => 'blance必须', //商家余额
            StoreBean::$updatedAt . POINST . "require " => 'updated_at必须', //
            StoreBean::$createdAt . POINST . "require " => 'created_at必须', //
        ];
        $this->scene = [
            self::$all => [
                StoreBean::$id,
                StoreBean::$userId,
                StoreBean::$serialNumber,
                StoreBean::$contactPhone,
                StoreBean::$email,
                StoreBean::$companyName,
                StoreBean::$contactName,
                StoreBean::$contactAddr,
                StoreBean::$signedAt,
                StoreBean::$contactAddrLng,
                StoreBean::$contactAddrLat,
                StoreBean::$attachment,
                StoreBean::$status,
                StoreBean::$memo,
                StoreBean::$rate,
                StoreBean::$openVip,
                StoreBean::$blance,
                StoreBean::$updatedAt,
                StoreBean::$createdAt,
            ],
            self::$add => [
                StoreBean::$contactPhone,
                StoreBean::$companyName,
                StoreBean::$contactName,
                StoreBean::$contactAddr,
                StoreBean::$contactAddrLng,
                StoreBean::$contactAddrLat,
            ],
            self::$edit => [
                StoreBean::$rate,
                StoreBean::$openVip,
            ],
            self::$pkId => [StoreBean::$id],
            self::$list => [StoreBean::$contactAddrLng,
                StoreBean::$contactAddrLat,]
        ];
    }


}
